package com.android.serialport;

import android.util.Log;

import com.android.serialport.itf.ParseDataListener;
import com.rfid.protocol.Instruction;

/**
 * @author Administrator
 * @date 2021/2/1
 */
public class DataBlockCommand extends Instruction {
    private ParseDataListener mParseDataListener;

    public DataBlockCommand(ParseDataListener listener) {
        mParseDataListener = listener;
    }

    @Override
    public byte[] getCommand() {
        return new byte[]{(byte) 0xFE, 0x23};
    }

    @Override
    public void invoke(byte[] data) {
        Log.e("DataBlockCommand", "data=" + bytesToHexString(data));
        mParseDataListener.onData("DataBlock", data);
    }
}